PATHMac OS 8 and 9 Developer Documentation > Interapplication Communication > AppleScript for Scripters >

AppleScript Language Guide

   

Make

Make is an application command that creates a new object. The command can include values for properties of the object, for the data of the object, or both.

SYNTAX
make [new] className at referenceToLocation                             ¬
    [ with properties                                                   ¬
        { propertyLabel:propertyValue [, propertyLabel:propertyValue ]...}]¬
    [ with data dataValue ]

The continuation characters (¬) indicate that the command must all be on one line (or on a line extended with continuation characters). They are not a required part of the syntax.

PARAMETERS
className
The class of the object to be created. Class: Class identifier
referenceToLocation
The location at which to create the new object. Class: Reference
propertyLabel
The name of a property whose value is to be set for the new object. Class: String
propertyValue
The value to assign to the property. Class: The value class of the property, as specified in the application dictionary definition of the object class being created, or a value that can be coerced into the class of the property Default value: The default value of the property, as specified in the application dictionary definition of the object class being created
dataValue
The value to assign to the object. Class: The default value class of the object, or a value that can be coerced into the default value class. Default value classes of objects are listed in the "Default Value Class Returned" sections of the dictionary definitions of the objects. Default value: None
RESULT

A reference to the newly created object.

Class: Reference

EXAMPLE

The following example creates a document named "New Report" in the current directory. (The current directory is typically the directory where the application was launched, the directory where the application last opened or saved a previous document, or another directory specified by the application. The current directory may be affected by settings in the General Controls control panel.)

tell application "AppleWorks"
    make new document at beginning with properties {name:"New Report"}
end tell

© 1999 Apple Computer, Inc. – (Last Updated 21 May 99)